<%--
  Created by IntelliJ IDEA.
  User: Zhou Wenying
  Date: 2023/3/10
  Time: 21:12
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="pragma" content="no-cache">
</head>
<body>

<!--header-->
<jsp:include page="/page/head2.jsp">
    <jsp:param name="flag" value="7"></jsp:param>
</jsp:include>
<!--//header-->
    <div>
<!--products-->
<div class="products">
    <div class="container clearfix">
        <h2 class="Contitle">
            <c:choose>
                <c:when test="${empty bookType && empty like }">全部系列</c:when>
                <c:otherwise>${bookType}</c:otherwise>
            </c:choose>
            <c:if test='${like != null && not empty like}'>
                搜索“${like}”结果为 ${books.size()} 条
            </c:if>
        </h2>

        <div id="pageMain" class="col-md-12 product-model-sec">

            <c:forEach items="${books}" var="g">
                <div>
                    <div class="product-grid">
                        <a href="/showBook?bookId=${g.bookId}">
                            <div class="more-product"><span> </span></div>
                            <div class="product-img b-link-stripe b-animate-go  thickbox">
                                <img src="/getImg?img=${g.bookImg}" class="img-responsive" alt="${g.bookName}" width="240" height="240">
                                <div class="b-wrapper">
                                    <h4 class="b-animate b-from-left  b-delay03">
                                        <button  onclick="window.location.href='/showBook?bookId=${g.bookId}'">查看详情</button>
                                    </h4>
                                </div>
                            </div>
                        </a>
                        <div class="product-info simpleCart_shelfItem">
                            <div class="product-info-cust prt_name">
                                <h4>${g.bookName}</h4>
                                <span class="item_price">
                                <div class="prices" style="text-align: center;">
                                <span style="color: black;font-size: 20px">￥${g.bookMoney}</span>
                                &nbsp;&nbsp;&nbsp;
                                <span style="color: #666;font-size: 20px"><del>￥${g.bookOldMoney}</del></span>
                            </div></span>
                                <input type="button" class="item_add items" value="加入购物车" onclick="addCart('${g.bookName}',${g.bookId})">
                                <div class="clearfix"> </div>
                            </div>
                        </div>
                    </div>
                </div>
            </c:forEach>

        </div>

        <div id="pageButton">
            <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-8">
                <a href="javascript:;" class="layui-laypage-prev" data-page="4">上一页</a>
                <a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">1</a>
                <span class="layui-laypage-spr">…</span>
                <a href="javascript:;" data-page="3">3</a>
                <a href="javascript:;" data-page="4">4</a>
                <span class="layui-laypage-curr"><em class="layui-laypage-em"></em><em>5</em></span>
                <a href="javascript:;" data-page="6">6</a>
                <a href="javascript:;" data-page="7">7</a>
                <span class="layui-laypage-spr">…</span>
                <a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="50">50</a>
                <a href="javascript:;" class="layui-laypage-next" data-page="6">下一页</a>
            </div>
        </div>

    </div>
</div>
</div>
<!--//products-->

<!--footer-->
<jsp:include page="/page/footer.jsp"></jsp:include>
<!--//footer-->
<script src="/static/js/layui-page.js"></script>
<script>
    var page = new LayuiPage("#pageMain","#pageButton",8,0);
</script>
</body>
</html>
